<div class="block list-form">
	<div class="block-title">
		<?=$block_title?>
		 <a href="<?php echo $this->createUrl('adv/create', array('type' => $type))?>" style="font-size: 14px;margin-right:20px;float: right;">
		 	[添加广告]
		   </a>
	</div>
	<form method="post">
		<?php
		$col = ($type=='banner')? array("type" => "raw", "name" => "图片", "value" => '"<img {$data->data[img_size]} src=\'/{$data->data[thumb]}\' /><br /> {$data->data[width]} x {$data->data[height]}"')
								: array('name' => '标题', 'value' => '$data->data["title"]');
		$this->widget('zii.widgets.grid.CGridView', array(
			'id'=>'adv-grid',
			'dataProvider'=>$dataProvider,
			'columns'=>array(
				array(
					'type' => 'raw',
					'name' => "选择",
					'value' => 'CHtml::checkbox("advs[]", null, array("value" => $data->adv_id))',
				),
				array('name' => '编号', 'value' => '$data->adv_id'),
				$col,
				array('name' => '类型', 'value' => '$data->type'),
				array('name' => '网站', 'value' => '$data->website'),
				array('name' => '点击数', 'value' => '$data->clicknum'),
				array('name' => '独立IP', 'value' => '$data->validclick'),
				array('name' => '注册数', 'value' => '$data->joinmb'),
				array('name' => '订单数', 'value' => '$data->ordernum'),
				array('name' => '订单金额', 'value' => '$data->order_amount'),
				array('name' => '操作', 'value' => '"<a href=\'/index.php/admin/adv/update?id={$data->adv_id}\'>编辑</a>"','type' => 'raw')
			),
		)); ?>
		
		<div class="op-list">
			<input type="submit" class="op-btn" action="<?php echo $this->createUrl('adv/delete', array('type' => $type))?>" value="删除" />
		</div>
		
		<script>
		$(function(){
			$(".op-btn").click(function(){
				$(this).parents('form:first').attr('action', $(this).attr('action')).submit();
			});
		});
		</script>
	</form>
</div>